<!DOCTYPE html>
<html lang="">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<link rel="stylesheet" href="plug/mui/css/app.css">
		<link rel="stylesheet" href="./plug/mui/css/mui.min.css">
		<link rel="stylesheet" href="plug/mui/css/mui.picker.min.css">
		<!-- <link rel="stylesheet" href="./css/net.css"> -->
		<link rel="stylesheet" href="./css/index_new.css">
		<link rel="stylesheet" href="./css/pop.css">
		<link rel="stylesheet" href="./css/modify.css">
		<link rel="stylesheet" href="css/old.css" />
		<title></title>

	</head>
	<!-- 2022年12月1日20:26:11 要加带点的页面 -->
	<body id="print">

		<div class="box" ontouchstart>
			<div class="content">
				<!--          -->
				<div class="header-box">
					<!--                <img src="./img/header-main.png" class="main-img" alt="">-->
					<!--                <img class="logo-box"  src="./img/logo.png"/>-->
					<!--                <img class="title-box"  src="./img/title.png"/>-->
					<div class="header-main-box">
						<div class="herder-img">
							<i><img src="./img/header-title.png" alt=""></i>
						</div>
						<span></span>
						<img src="./img/account.png" />
						<div class="name-box">

						</div>
						<span></span>
						<img src="./img/set.png" class="set-img" />
						<!-- <span style="margin-left: 20px"></span>
                    <img src="./img/logout.png " class="logout-img" /> -->
					</div>
				</div>
				<div class="tips-box">
					<div class="tips"> 当前车辆：<span class="vehicles"></span></div>
					<!-- <div class="tips">绑定工站：<span class="workstation"></span></div>
					<div id="android"></div> -->
					<div class="btn-type-list">
						<ul>
							<li>3T</li>
							<li>7T</li>
							<li>16T</li>
							<li>32T</li>
                            <li class="active">全部</li>
						</ul>
					</div>
					<div class="order-list-box">
						<div class="order-list-main an-order">
							<div class="t_news" id="orderList">
								<ul class="news_li">

								</ul>
							</div>
							<!-- <span>查看更多</span> -->
						</div>
						<div class="order-list-main no-order">
							暂无订单
						</div>
					</div>
				</div>
				<div id="container" class="main-box">
					<div id="zoomable">
						<div class="bg-img-box">
							<i><img src="./img/bg-3.jpg" class="svg-img" alt=""></i>
							<i><img src="./img/bg-7.jpg" class="svg-img" alt=""></i>
							<i><img src="./img/bg-16.jpg" class="svg-img" alt=""></i>
							<i><img src="./img/bg-32.jpg" class="svg-img" alt=""></i>
							<i class="active"><img src="./img/bg-c.jpg" class="svg-img" alt=""></i>
						</div>
						<!-- <im g src="./img/bgwq-c.jpg" class="svg-img" alt=""> -->
						<div class="svg-box">
							<svg id="svgcanvas" height="100%" width="100%">
								<g style="transform: translate(0, 10px)">
									<path :d="line" />
								</g>
							</svg>
							<div class="svg-up-box">
								<div class="select-work-box-1 select-work-box" onclick="getWorkStationInfo(1)"></div>
								<div class="select-work-box-2 select-work-box" onclick="getWorkStationInfo(2)"></div>
								<div class="select-work-box-3 select-work-box" onclick="getWorkStationInfo(3)"></div>
								<div class="select-work-box-4 select-work-box" onclick="getWorkStationInfo(4)"></div>
								<div class="select-work-box-5 select-work-box" onclick="getWorkStationInfo(5)"></div>
								<div class="select-work-box-6 select-work-box" onclick="getWorkStationInfo(6)"></div>
								<div class="select-work-box-7 select-work-box" onclick="getWorkStationInfo(7)"></div>
								<div class="select-work-box-8 select-work-box" onclick="getWorkStationInfo(8)"></div>
								<div class="select-work-box-9 select-work-box" onclick="getWorkStationInfo(9)"></div>
								<div class="select-work-box-10 select-work-box" onclick="getWorkStationInfo(10)"></div>
								<div class="select-work-box-11 select-work-box" onclick="getWorkStationInfo(11)"></div>
                                <div class="select-work-box-12 select-work-box" onclick="getWorkStationInfo(12)"></div>
                                <div class="select-work-box-13 select-work-box" onclick="getWorkStationInfo(13)"></div>
                                <div class="select-work-box-14 select-work-box" onclick="getWorkStationInfo(14)"></div>
                                <div class="select-work-box-15 select-work-box" onclick="getWorkStationInfo(15)"></div>
                                <div class="select-work-box-16 select-work-box" onclick="getWorkStationInfo(16)"></div>
                                <div class="select-work-box-17 select-work-box" onclick="getWorkStationInfo(17)"></div>
                                <div class="select-work-box-18 select-work-box" onclick="getWorkStationInfo(18)"></div>
                                <div class="select-work-box-19 select-work-box" onclick="getWorkStationInfo(19)"></div>
                                <div class="select-work-box-20 select-work-box" onclick="getWorkStationInfo(20)"></div>
                                <div class="select-work-box-21 select-work-box" onclick="getWorkStationInfo(21)"></div>
                                <div class="select-work-box-22 select-work-box" onclick="getWorkStationInfo(22)"></div>
                                <div class="select-work-box-23 select-work-box" onclick="getWorkStationInfo(23)"></div>
                                <div class="select-work-box-24 select-work-box" onclick="getWorkStationInfo(24)"></div>
                                <div class="select-work-box-25 select-work-box" onclick="getWorkStationInfo(25)"></div>
                                <div class="select-work-box-26 select-work-box" onclick="getWorkStationInfo(26)"></div>
                                <div class="select-work-box-27 select-work-box" onclick="getWorkStationInfo(27)"></div>
                                <div class="select-work-box-28 select-work-box" onclick="getWorkStationInfo(28)"></div>
                                <div class="select-work-box-29 select-work-box" onclick="getWorkStationInfo(29)"></div>
                                <div class="select-work-box-30 select-work-box" onclick="getWorkStationInfo(30)"></div>
                                <div class="select-work-box-31 select-work-box" onclick="getWorkStationInfo(31)"></div>
                                <div class="select-work-box-32 select-work-box" onclick="getWorkStationInfo(32)"></div>
                                <div class="select-work-box-33 select-work-box" onclick="getWorkStationInfo(33)"></div>
                                <div class="select-work-box-34 select-work-box" onclick="getWorkStationInfo(34)"></div>
                                <div class="select-work-box-35 select-work-box" onclick="getWorkStationInfo(35)"></div>
                                <div class="select-work-box-36 select-work-box" onclick="getWorkStationInfo(36)"></div>
                                <div class="select-work-box-37 select-work-box" onclick="getWorkStationInfo(37)"></div>
                                <div class="select-work-box-38 select-work-box" onclick="getWorkStationInfo(38)"></div>
                                <div class="select-work-box-39 select-work-box" onclick="getWorkStationInfo(39)"></div>
                                <div class="select-work-box-40 select-work-box" onclick="getWorkStationInfo(40)"></div>
                                <div class="select-work-box-41 select-work-box" onclick="getWorkStationInfo(41)"></div>
                                <div class="select-work-box-42 select-work-box" onclick="getWorkStationInfo(42)"></div>
                                <div class="select-work-box-43 select-work-box" onclick="getWorkStationInfo(43)"></div>
                                <div class="select-work-box-44 select-work-box" onclick="getWorkStationInfo(44)"></div>
                                <div class="select-work-box-45 select-work-box" onclick="getWorkStationInfo(45)"></div>
                                <div class="select-work-box-46 select-work-box" onclick="getWorkStationInfo(46)"></div>
                                <div class="select-work-box-47 select-work-box" onclick="getWorkStationInfo(47)"></div>
                                <div class="select-work-box-48 select-work-box" onclick="getWorkStationInfo(48)"></div>
							</div>
							<!-- <div class="magnifier-box">
								<img src="./img/magnifier.png" alt="">
							</div> -->
						</div>
					</div>
				</div>
				<div class="operate-box operate-box-main">
					<div class="show-img">
						<img src="./img/show.png" alt="">
					</div>
					<div class="order-list">
						<div class="no-wet">
							<div>
								<img src="./img/netless.png" alt="无网">
								<span>当前网络不可用,请确认连接WT</span>
							</div>

						</div>
						<div class="order-main">

						</div>
						<div style="height: 50px">
							<div class="order-btn-box">
								<div class="order-btn">
									<div>确定</div>
									<div>编辑</div>
									<div>取消</div>
									<div>删除</div>
								</div>
							</div>
						</div>

					</div>
					<div class="new-btn-box">
						<div class="stop-box stop-btn">
							<div class="img-box">
								<img src="./img/stop.png" alt="急停">
								<img src="./img/stop-active.png" alt="急停">
							</div>
						</div>
						<div class="pattern-box">
							<div class="pattern-list active">
								<span>调度模式</span>
							</div>
							<div class="pattern-list">
								<span>遥控模式</span>
							</div>
						</div>
						<div class="btn-list last action-list">
							<div class="pattern-btn active first">
								<div class="btn-box">
									<div class="btn">
										<span>一键</span>
										<span>充电</span>
									</div>
								</div>
								<!--<div class="btn-box">
									<div class="btn">
										<span>重</span>
										<span>定位</span>
									</div>
								</div>-->
								<!-- <div class="btn-box">
									<div class="btn">
										<span>多个</span>
										<span>工站</span>
									</div>
								</div> -->
								<div class="btn-box">
									<div class="btn">
										<span>指定</span>
										<span>工站</span>
									</div>
								</div>

								<div class="btn-box">
										<div class="btn">
											<span>取消</span>
											<span>订单</span>
										</div>
									</div>
							</div>
							<div class="pattern-btn">
								<div class="second-box zero">
									<div class="zero-box flex-box">
										<div class="btn-box">
											<div class="btn">
												避障
											</div>
										</div>
									</div>
								</div>
								<div class="second-box three">
									<div class="three-box flex-box">
										<div class="second-list">
											<div class="btn-box">
												<div class="btn">
													左旋转
												</div>
											</div>
											<div class="btn-box">
												<div class="btn h">
													左横移
												</div>
											</div>
										</div>
										<div class="second-list">
											<div class="btn-box">
												<div class="btn">
													右旋转
												</div>
											</div>
											<div class="btn-box">
												<div class="btn h">
													右横移
												</div>
											</div>
										</div>
									</div>
								</div>
								<div class="second-box">
									<div class="two-box flex-box">
										<div class="second-list">
											<div class="btn-box">
												<div class="btn">
													<span>进充</span>
													<span>电桩</span>
												</div>
											</div>
											<div class="btn-box">
												<div class="btn">
													<span>开始</span>
													<span>充电</span>
												</div>
											</div>
											<div class="btn-box">
												<div class="btn">
													<span>结束</span>
													<span>充电</span>
												</div>
											</div>
										</div>
										<div class="second-list">
											<div class="btn-box">
												<div class="btn">
													顶升
												</div>
											</div>
											<div class="btn-box">
												<div class="btn">
													顶落
												</div>
											</div>
											<div class="btn-box">
												<div class="btn">
													重启
												</div>
											</div>
										</div>
									</div>

								</div>
								<div class="second-box three">
									<div class="flex-box one-box">
										<div class="second-list">
											<div class="btn-box">
												<div class="btn">
													前进
												</div>
											</div>
											<div class="btn-box">
												<div class="btn">
													左微调
												</div>
											</div>
										</div>

										<div class="second-list">
											<div class="btn-box">
												<div class="btn">
													后退
												</div>
											</div>
											<div class="btn-box">
												<div class="btn">
													右微调
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="stop-btn switch-box">
							<div>
<!--								<span>模式：</span>-->
<!--								<div class="mui-switch-box">-->
<!--									<div class="mui-switch-posit"></div>-->
<!--									<div class="mui-switch">-->
<!--										<div class="mui-switch-handle"></div>-->
<!--									</div>-->
<!--								</div>-->

							</div>
<!--							<div class="low-btn">-->
<!--								解除电量限制-->
<!--							</div>-->
						</div>
						<!-- 	<div class="stop-btn voice-box">
            <div class="active">
                <img src="./img/off1.png" alt="声音关">
            </div>
            <div>

                <img src="./img/on.png" alt="声音开">
            </div>
        </div> -->
					</div>

				</div>
				<div class="show-img overall">
					<img src="./img/show.png" alt="">
				</div>
			</div>
			<div class="popup-box popup-vehicles-info">
				<div class="popup-content">
					<div class="popup-header">
						<img class="x" src="./img/x.png" />
					</div>
					<div class="popup-main">
						<div class="vehicles-info-details"></div>
						<div id="orderInfo"></div>
					</div>
				</div>
			</div>
			<div class="popup-box popup-work-station">
				<div class="popup-content">
					<div class="popup-header">
						<img class="x" src="./img/x.png" />
					</div>
					<div class="popup-main">
						<div>
							<table>
								<thead>
									<tr>
										<th>名称</th>
										<th>地点</th>
										<!--<th>动作</th>-->
										<!--<th>下一站</th>-->
										<th>操作</th>
									</tr>
								</thead>
								<tfoot class="table-main">
								</tfoot>
							</table>
						</div>
					</div>
					<div class="popup-footer">
						<div class="btn add">添加</div>
						<div class="btn config">确定</div>
					</div>
				</div>
			</div>
			<!-- 订单 -->
			<div class="popup-box popup-order">
				<div class="popup-content">
					<div class="popup-header">
						<img class="x" src="./img/x.png" />
					</div>
					<div class="popup-main">
						<div>
							<table>
								<thead>
									<tr>
										<th>名称</th>
										<th>执行车辆</th>
										<th>预定车辆</th>
										<th>目的工站</th>
										<th>状态</th>
										<th>动作</th>
										<th>操作</th>
									</tr>
								</thead>
								<tfoot class="table-main">
								</tfoot>
							</table>
						</div>
					</div>
					<div class="popup-footer">
						<div class="btn config">关闭</div>
					</div>
				</div>
			</div>
			<div class="popup-box factor work-factor">

				<div class="factor-box">
					<div class="input-box">
						<div class="flex">
							<span>名称：</span>
							<div class="input">
								<input class="name" placeholder="请输入名称" type="text">
							</div>
						</div>
						<div class="flex">
							<span>地点：</span>
							<div class="input select select-site">
								<input class="place" disabled placeholder="请选择地点" type="text">
								<img src="./img/triangle.png" />
							</div>
						</div>
					</div>
					<div class="btn-box">
						<div class="btn addCancel">取消</div>
						<div class="btn addConfirm">确定</div>
					</div>
				</div>
			</div>
			<div class="popup-box popup-work-info">
				<div class="popup-content">
					<div class="popup-header">
						<img class="x" src="./img/x.png" />
					</div>
					<div class="popup-main">
						<div>
							<table>
								<thead>
									<tr>
										<th>名称</th>
										<th>绑定信息</th>
										<th>操作</th>
									</tr>
								</thead>
								<tfoot class="table-main">
								</tfoot>
							</table>
						</div>
					</div>
					<div class="popup-footer">
						<div class="btn config">确定</div>
					</div>
				</div>
			</div>
			<div class="popup-box popup-vehicle-info">
				<div class="popup-content">
					<div class="popup-header">
						<img class="x" src="./img/x.png" />
					</div>
					<div class="popup-main">
						<div>
							<table>
								<thead>
									<tr>
										<th>名称</th>
										<th>电池电量</th>
										<th>类型</th>
										<th>操作</th>
									</tr>
								</thead>
								<tfoot class="table-main">
								</tfoot>
							</table>
						</div>
					</div>
					<div class="popup-footer">
						<div class="btn config">确定</div>
					</div>
				</div>
			</div>
			<div class="popup-box popup-wifi-info">
				<div class="popup-content">
					<div class="popup-header">
						<img class="x" src="./img/x.png" />
					</div>
					<div class="popup-main">
						<div>
							<table>
								<thead>
									<tr>
										<th>wifi名称</th>
										<!-- <th>电池电量</th> -->
										<th>操作</th>
									</tr>
								</thead>
								<tfoot class="table-main">
								</tfoot>
							</table>
						</div>
					</div>
					<div class="popup-footer">
						<div class="btn config">确定</div>
					</div>
				</div>
			</div>
			<!-- 物料架   -->
			<div class="popup-box popup-rack-info">
				<div class="popup-content">
					<div class="popup-header">
						<img class="x" src="./img/x.png" />
					</div>
					<div class="popup-main">
						<div>
							<table>
								<thead>
									<tr>
										<th>编号</th>
										<th>位置</th>
										<th>x轴坐标</th>
										<th>y轴坐标</th>
										<th>操作</th>
									</tr>
								</thead>
								<tfoot class="table-main">
								</tfoot>
							</table>
						</div>
					</div>
					<div class="popup-footer">
						<div class="btn add">添加</div>
						<div class="btn config">确定</div>
					</div>
				</div>
			</div>
			<div class="popup-box rack-factor factor">
				<div class="factor-box">
					<div class="input-box">
						<div class="flex">
							<span>编号：</span>
							<div class="input">
								<input class="name" placeholder="请输入编号" type="text" maxlength="10">
							</div>
						</div>
						<div class="flex">
							<span>位置：</span>
							<div class="input select select-site">
								<input class="place" disabled placeholder="请选择工站" type="text">
								<img src="./img/triangle.png" />
							</div>
						</div>
					</div>
					<div class="btn-box">
						<div class="btn addCancel">取消</div>
						<div class="btn addConfirm">确定</div>
					</div>
				</div>
			</div>
			<div class="new-popup new-ip-popup">
				<div class="mui-popup"></div>
				<div class="mui-popup mui-popup-in">
					<div class="mui-popup-inner">
						<div class="mui-popup-title">提示</div>
						<div class="mui-popup-text">ip</div>
						<div class="mui-popup-input">
							<input type="text" autofocus="" placeholder="请输入ip地址" id="ipInput">
						</div>
					</div>
					<div class="mui-popup-buttons">
						<span class="mui-popup-button cancel">取消</span>
						<span class="mui-popup-button mui-popup-button-bold">确定</span>
					</div>
				</div>
			</div>
			<!-- <div class="new-wifi-popup new-popup">
				<div class="mui-popup"></div>
				<div class="mui-popup mui-popup-in">
					<div class="mui-popup-inner">
						<div class="mui-popup-title">wifi密码</div>
						<div class="mui-popup-text">密码</div>
						<div class="mui-popup-input">
							<input type="password" autofocus="" placeholder="请输入wifi密码" id="wifiPassword">
						</div>
					</div>
					<div class="mui-popup-buttons">
						<span class="mui-popup-button cancel">取消</span>
						<span class="mui-popup-button mui-popup-button-bold">确定</span>
					</div>
				</div>
			</div> -->
			<div class="popup-box popup-reposition">
				<div class="popup-content">
					<div class="popup-header">
						<img class="x" src="./img/x.png" />
					</div>
					<div class="popup-main">
						<div class="flex-box">
							<div class="mui-input-row mui-input-range">
								<label>x轴坐标</label>
								<input type="range" min="-100" max="100">
							</div>
							<div class="input-box" id="x-input">
								<input type="number" oninput="if(value>100)value=100; if(value<-100)value=-100"
									placeholder="请输入x轴坐标">
							</div>
						</div>
						<div class="flex-box">
							<div class="mui-input-row mui-input-range" id="y-axis">
								<label>y轴坐标</label>
								<input type="range" min="-100" max="100">
							</div>
							<div class="input-box" id="y-input">
								<input type="number" oninput="if(value>100)value=100; if(value<-100)value=-100"
									placeholder="请输入y轴坐标">
							</div>
						</div>
						<div class="flex-box">
							<div class="mui-input-row mui-input-range" id="angle">
								<label>旋转角度</label>
								<input type="range" min="-180" max="180">
							</div>
							<div class="input-box" id="angle-input">
								<input type="number" oninput="if(value>180)value=180; if(value<-180)value=-180"
									placeholder="请输入旋转角度">
							</div>
						</div>
					</div>
					<div class="popup-footer">
						<div class="btn config">取消</div>
						<div class="btn confirm">确定</div>
					</div>
				</div>
			</div>
				<!-- 多个-->
			<div class="popup-box popup-multiple-station">
				<div class="popup-content">
					<div class="popup-header">
						<img class="x" src="./img/x.png" />
					</div>
					<div class="popup-main">
						<div class="popup-btn-box"></div>
						<div class="operate-box">
							<div class="order-list">

								<div class="order-main">

								</div>
								<div style="height: 50px">
									<div class="order-btn-box">
										<div class="order-btn">
											<div>确定</div>
											<div>编辑</div>
											<div>取消</div>
											<div>删除</div>
										</div>
									</div>
								</div>

							</div>
						</div>
					</div>
					<div class="popup-footer">
						<div class="btn config">取消</div>
						<div class="btn confirm">确定</div>
					</div>
				</div>

			</div>
			<div class="popup-box popup-workStation">
				<div class="popup-content">
					<div class="popup-header">
						<img class="x" src="./img/x.png" />
					</div>
					<div class="popup-main">
						<div class="popup-btn-box"></div>
						<div class="operate-box">
							<div class="order-list">

								<div class="order-main">
									<div class="flex-1">
										<div class="order-radio">
										</div>
										<div class="order-input flex-box">
											<p>名称：</p>
											<input type="search" placeholder="请输入工站名称">
										</div>
									</div>
								</div>
								<div style="height: 50px">
									<div class="order-btn-box">
										<div class="order-btn">
											<div>确定</div>
											<div>取消</div>
										</div>
									</div>
								</div>

							</div>
						</div>
					</div>
					<div class="popup-footer">
						<div class="btn config">取消</div>
						<div class="btn confirm">确定</div>
					</div>
				</div>
			</div>
			<div class="popup-box popup-selectWorkStation">
				<div class="popup-content">

					<div class="popup-main new">
						<div class="popup-img-box"></div>
						<div class="popup-select-footer">
							<div class="btn config">关闭</div>
						</div>
					</div>

				</div>
			</div>
			<div class="popup-box popup-selectVehicles">
				<div class="popup-content">
					<div class="popup-main new">
						<div class="popup-img-box"></div>
						<div class="popup-select-footer">
							<div class="btn config">关闭</div>
						</div>
					</div>

				</div>
			</div>
		</div>
	</body>
	<script src="plug/jquery.min.js"></script>
	<script src="js/set-promise-interval.js"></script>
	<script src="js/parameter.js"></script>
	<script src="plug/mui/js/mui.min.js"></script>
	<script src="plug/mui/js/mui.picker.min.js"></script>
	<script src="js/muiLoading.js"></script>
	<script src="plug/d3.v5.min.js"></script>
	<!-- <script src="js/img.js"></script> -->
	<script src="js/wifi.js"></script>
	<script src="js/data.js"></script>
	<script src="js/index.js"></script>
	<script src="js/map.js"></script>
	<script src="js/main.js"></script>
	<script src="js/spot.js"></script>
	<script src="js/svgImg.js"></script>
	<script type="text/javascript">
		document.addEventListener('plusready', function() {
			getWifiInfo()
			//pause：监听APP是否进入后台
			document.addEventListener('pause', function() {
				window.location = 'new_file.html';
				/*
				 * pause：是指当APP进入后台运行时，才会触发；
				 * 例如，当前运行的是APP-1，在你回到桌面时，这个APP-1的pause监听事件才会被触发此方法
				 */
				console.log("切换到进入后台");
			});
			//resume：监听APP是否从后台切换到前台（就是当前运行）
			document.addEventListener('resume', function() {
				/*
				 * resume：是指APP从后台运行进入当前运行；
				 * 例如，APP-1处于后台运行，当APP-1切换到当前运行时，才会被触发此方法
				 * 作用：可以作为唤醒APP时，请求数据或者刷新数据
				 */
				// window.location.reload()
				// #ifdef APP-PLUS
				// plus.runtime.restart()
				// #endif
				console.log("切换到当前运行");
			});
			//plusscrollbottom：界面向上↑滑动
			document.addEventListener('plusscrollbottom', function() {
				/*
				 * plusscrollbottom：是指界面向上↑滑动到底后才会被触发此方法
				 * 适用于上拉刷新或加载更多功能
				 */
				console.log("已经向上滑动到底了");
			});

		}, false);
		$(document).ready(function() {
			mui.init();

			let width = document.documentElement.clientWidth;
			let height = document.documentElement.clientHeight;
			console.log("宽高:" + height + '--' + width);
			$('#witdth').text("宽高:" + height + '--' + width)
			if (width < height) {
				$print = $('#print');
				$print.width(height);
				$print.height(width);
				$print.css('top', (height - width) / 2);
				$print.css('left', 0 - (height - width) / 2);
				$print.css('transform', 'rotate(90deg)');
				$print.css('transform-origin', '50% 50%');
			}

			// ip
			ipValue = localStorage.getItem('ipValue') || "127.0.0.1";
			// 选择车辆
			vehicles = localStorage.getItem('vehicles') || ""
			// ipValue='192.168.0.98'
			// H5 plus事件处理
			if (window.plus) {
				getDeviceUuid();
			} else {
				document.addEventListener('plusready', getDeviceUuid, false);
				plateNumber = '1e718c6916dcad7c'
				ping()
			}
			userName = localStorage.getItem('userName') || "河南卫特机器人有限公司"
			$('.name-box').html(userName)

			function getDeviceUuid() {
				var mainActivity = plus.android.runtimeMainActivity();
				var Settings = plus.android.importClass("android.provider.Settings");
				plateNumber = Settings.Secure.getString(mainActivity.getContentResolver(), Settings.Secure.ANDROID_ID)
				// plateNumber = '1e718c6916dcad7c'.
				ping()
			}

			workstation = localStorage.getItem('workstation') || "";

			if (!ipValue) {
				toastText('请先设置ip')
			} else {}

			// ip 设置
			$('.new-ip-popup .mui-popup .mui-popup-buttons .mui-popup-button-bold').click(function() {
				let val = $('#ipInput').val().trim()
				let flag = isValidIP(val)
				if (!flag) {
					toastText('请输入正确的IP地址')
					return false
				}
				ipValue = val
				localStorage.setItem('ipValue', val);
				ping()

			})
			$('.new-ip-popup .mui-popup .mui-popup-buttons .cancel').click(function() {
				ping()
			})
			// wifi 密码设置
			$('.new-wifi-popup .mui-popup .mui-popup-buttons .mui-popup-button-bold').click(function() {
				let val = $('#wifiPassword').val().trim()
				if (val.length < 8) {
					toastText('请输入正确的wifi密码')
					return false
				}
				wifiPassword = val
				reloadWifi()

			})
			$('.new-ip-popup .mui-popup .mui-popup-buttons .cancel').click(function() {
				$('.new-popup').hide()
			})

			//  修改当前wifi密码
			$('.popup-wifi-info .table-main').on('click', '.btn-span .edit', function() {
				let workstationArr = getWorkstation(),
						name = $(this).parents('tr').children('.name').text()
				wifiSSID = name
				$('.new-wifi-popup').show()

			})
			// 退出
			$('.logout-img').click(function() {
				const btnArray = ['退出', '取消'];
				mui.confirm('您确定退出?', '', btnArray, function(e) {
					if (e.index == 0) {
						logout()
					} else {}
				})
			})

			function logout() {
				localStorage.removeItem('token')
				localStorage.removeItem('userName')
				// window.location.href = 'login.html'
			}

			// 获取所有物料架信息
			function getAllMaterialRack() {
				getRack(getAllRackInfo())
			}


			//物料架 编辑
			$('.popup-rack-info .table-main').on('click', '.btn-span .edit', function() {
				rackEdit = true;
				let name = $(this).parents('tr').children('.name').text(),
					y = '',
					x = '',
					workName = ''
				getAllRackInfo().map(item => {
					if (name == item.serialNumber) {
						rackId=item.id
						x = item.coordinates_x
						y = item.coordinates_y
					}
				})

				getWorkstationSiteInfo().map(item => {

					if (x == item.x && y == item.y) {
						workName = item.name
					}

				})
				$('.rack-factor').show()
				$('.rack-factor .factor-box .input-box .name').val(name)
				$('.rack-factor .factor-box .input-box .place').val(workName)
			})
			//物料架删除
			$('.popup-rack-info .table-main').on('click', '.btn-span .del', function() {
				let name = $(this).parents('tr').children('.name').text(),
					id = ''
				getAllRackInfo().map(item => {
					if (name == item.serialNumber) {
						id = item.id
					}
				})
				var btnArray = ['删除', '取消'];
				mui.confirm('您确定删除?', '', btnArray, function(e) {
					if (e.index == 0) {

						mui.showLoading("正在加载..", "div");
						// 确认退出触发事件http://localhost:55200/v1/materialRack/deleteById?id=2
						$.ajax({
							url: `http://${ipValue}:55200/v1/materialRack/deleteById?id=${id}`,
							contentType: "multipart/form-data",
							data: '',
							type: "post",
							async: !workInfo,
							dataType: "json",
							success: (res) => {
								mui.hideLoading();
								if (res.code == 200) {
									toastText('添加成功')
									getAllMaterialRack()
								} else {
									toastText(res.msg)
									logout()
								}
							},
							timeout: timeOut,
							error: () => {
								overTime()
							}
						})
					} else {}
				})
			})
			//添加物料架
			$('.popup-rack-info .popup-footer .add.btn').click(function() {
				rackEdit = false
				$('.rack-factor').show()
				$('.rack-factor .factor-box .input-box .name').val()
				$('.rack-factor .factor-box .input-box .place').val()
				// $('.work-factor .factor-box .input-box .next').val()
				$('.rack-factor .factor-box .input-box .action').val()
			})
			// 物料架 选择工站
			$('.rack-factor .select-site').click(function() {
				var picker = new mui.PopPicker();
				let arr = [],
					data = getWorkstationSiteInfo()
				data.map(item => {
					arr.push({
						text: item.name
					})
				})
				picker.setData(arr)
				picker.show(function(SelectedItem) {
					$('.rack-factor .select-site input').val(SelectedItem[0].text)
					// $('.rack-factor .select-site input').val('4')
				})
			})
			//添加修改 物料
			$('.rack-factor .factor-box .btn-box .addCancel').click(function() {
				$('.rack-factor .factor-box .input-box .name').val('')
				$('.rack-factor .factor-box .input-box .place').val('')
				// $('.work-factor .factor-box .input-box .action').val('')
				// $('.work-factor .factor-box .input-box .next').val('')
				$('.rack-factor').hide()
			})
			$('.rack-factor .factor-box .btn-box .addConfirm').click(function() {
				let serialNumber = $('.rack-factor .factor-box .input-box .name').val(),
					siteName = $('.rack-factor .factor-box .input-box .place').val(),
					coordinates_x = 0,
					coordinates_y = 0,
					locationName = ''
				getWorkstationSiteInfo().map(item => {
					if (siteName == item.name) {
						coordinates_x = item.x
						coordinates_y = item.y
						locationName = item.siteName
					}
				})
				// action = $('.work-factor .factor-box .input-box .action').val()
				if (!serialNumber) {
					toastText('请输入物料架编号')
					return false
				}
				if (!siteName) {
					toastText('请选择地点')
					return false
				}
				let data = {
					serialNumber,
					locationName,
					coordinates_x,
					coordinates_y
				}
				if (rackEdit) {
					data.id=rackId
					$.ajax({
						///
						url: `http://${ipValue}:55200/v1/materialRack/updateById`,
						contentType: "application/json",
						data: JSON.stringify(data),
						type: "POST",
						dataType: "json",
						success: (res) => {
							console.log(res );
							if (res.code == 200) {
								toastText('修改成功')
								getAllMaterialRack()
								$('rack-factor.factor-box .input-box .name').val('')
								$('rack-factor .factor-box .input-box .place').val('')
								// $('.work-factor .factor-box .input-box .next').val('')
								$('.rack-factor').hide()
							}else{
								backErr(res.msg)
							}
						},
						timeout: timeOut,
						error: () => {
							overTime()
						}
					})
				} else {

					$.ajax({
						url: `http://${ipValue}:55200/v1/materialRack/add`,
						contentType: "application/json",
						data: JSON.stringify(data),
						type: "POST",
						dataType: "json",
						success: (res) => {
							if (res.code == 200) {
								// getWorkstationSite()
								toastText('添加成功')
								getAllMaterialRack()
								$('rack-factor.factor-box .input-box .name').val('')
								$('rack-factor .factor-box .input-box .place').val('')
								// $('.work-factor .factor-box .input-box .next').val('')
								$('.rack-factor').hide()
							}else{
								backErr(res.msg)
							}
						},
						timeout: timeOut,
						error: () => {
							overTime()
						}
					})
				}
			})
			$(".tips-box .workstation").text(workstation)
			$(".tips-box .vehicles").text(vehicles)
			/*弹窗*/
			$('.popup-box .config').click(function() {
				$('.popup-box ').hide()
				returnZero()
			})
			$('.set-img').click(function() {
				var picker = new mui.PopPicker();
				picker.setData([{
					value: 'ip',
					text: 'ip设置'
				}, {
					value: 'workStation',
					text: '工站设置'
				// }, {
				// 	value: 'current',
				// 	text: '设置当前工站'
				}, {
					value: 'vehicle',
					text: '车辆信息'
				},
				// {
				// 	value: 'rack',
				// 	text: '物料架管理'
				// }, {
				// 	value: 'wifi',
				// 	text: '选择wifi'
				// },
				 ]);
				picker.show(function(selectItems) {
					console.log(selectItems ,99);
					if (selectItems[0].value == 'workStation') {
						setTable(getWorkstation())
						$('.popup-box.popup-work-station').show()
					} else if (selectItems[0].value == 'ip') {
						setIp()
					} else if (selectItems[0].value == 'current') {
						// popPickerWorkstation(1)
						setWorkInfo(getWorkstation(), plateNumber)
						$('.popup-work-info').show()
					} else if (selectItems[0].value == 'vehicle') {
						// popPickerWorkstation(1)
						vehiclesinfo();
						$('.popup-vehicle-info').show()
					} else if (selectItems[0].value == 'rack') {
						// popPickerWorkstation(1)
						getAllMaterialRack();
						$('.popup-rack-info').show()
					} else if (selectItems[0].value == 'wifi') {
						// popPickerWorkstation(1)
						let resultList = loadWifiInfo(),
							wifiArr = []
						for (var i = 0; i < resultList.size(); i++) {
							var sSID = resultList.get(i).plusGetAttribute('SSID')
							console.log(resultList.get(i).plusGetAttribute('SSID'));
							if(sSID){
								wifiArr.push(sSID)
							}

						}
						var newArr = [...new Set(wifiArr)];
						 setWiFiInfo(newArr,wifiSSID)
						 $('.popup-box.popup-wifi-info').show()
					}
				})

			})


			$('.x').click(function() {
				$('.popup-box').hide()
			})
			//选择下一站
			$('.select-next').click(function() {
				popPickerWorkstation(2)

			})
			//添加工站
			$('.popup-work-station .popup-footer .add.btn').click(function() {
				workstationEdit = false
				$('.work-factor').show()
				$('.work-factor .factor-box .input-box .name').val()
				$('.work-factor .factor-box .input-box .place').val()
				// $('.work-factor .factor-box .input-box .next').val()
				$('.work-factor .factor-box .input-box .action').val()
			})
			// JSON.parse:
			//选择工站
			$('.work-factor .select-site').click(function() {
				var picker = new mui.PopPicker();
				let arr = [],
					data = getLocations()
				data.map(item => {
					arr.push({
						value: item.type.name,
						text: item.name
					})
				})
				picker.setData(arr)
				picker.show(function(SelectedItem) {
					$('.work-factor .select-site input').val(SelectedItem[0].text)
					$('.work-factor .select-action input').val('')
					allowedOperations = locationType(SelectedItem[0].value)
				})
			})
			//选择动作
			$('.select-action').click(function() {
				if (allowedOperations && allowedOperations.length) {
					var picker = new mui.PopPicker();
					let arr = []
					allowedOperations.map(item => {
						arr.push({
							text: item
						})
					})
					picker.setData(arr)
					picker.show(function(SelectedItem) {
						$('.select-action input').val(SelectedItem[0].text)
					})
				} else {
					toastText('请先选择地点')
				}

			})

			//添加 修改工站
			$('.popup-work-station .table-main').on('click', '.btn-span .edit', function() {
				let workstationArr = getWorkstation(),
					name = $(this).parents('tr').children('.name').text(),
					info = {}
				workstationArr.map((item, index) => {
					if (item.name === name) {
						info = {
							...item
						}
					}

				})
				if (info.plateNumber) {
					toastText('已绑定其他工站,请先解绑,在进行编辑删除操作')
					if (info.plateNumber === plateNumber) {
						toastText('已绑定当前工站,请先解绑,在进行编辑删除操作')
					}
				} else {
					$('.work-factor').show()
					workstationEdit = true
					workstationEditInfo = info
					$('.work-factor .factor-box .input-box .name').val(workstationEditInfo.name)
					$('.work-factor .factor-box .input-box .place').val(workstationEditInfo.siteName)
					// $('.work-factor .factor-box .input-box .next').val(workstationEditInfo.nextStation)
					$('.work-factor .factor-box .input-box .action').val(workstationEditInfo.operation)
				}
			})
			//删除工站
			$('.popup-work-station .table-main').on('click', '.btn-span .del', function() {
				let workstationArr = getWorkstation(),
					info = {},
					name = $(this).parents('tr').children('.name').text()
				workstationArr.map((item, index) => {
					if (item.name === name) {
						info = {
							...item
						}
					}

				})
				if (info.plateNumber) {
					toastText('已绑定其他工站,请先解绑,在进行编辑删除')
					if (info.plateNumber === plateNumber) {
						toastText('已绑定当前工站,请先解绑,在进行编辑删除')
					}
				} else {
					var btnArray = ['删除', '取消'];
					mui.confirm('您确定删除?', '', btnArray, function(e) {
						if (e.index == 0) {
							// 确认退出触发事件
							workstationArr.map((item, index) => {
								if (name === item.name) {
									$.ajax({
										url: `http://${ipValue}:55200/v1/workstation/delete?id=${item.id}`,
										contentType: "multipart/form-data",
										data: '',
										type: "post",
										async: !workInfo,
										dataType: "json",
										success: (res) => {
											if (res.code == 200) {
												toastText('删除成功')
												setTable(getWorkstation())
												$('.work-factor .factor-box .input-box .name')
													.val('')
												$('.work-factor .factor-box .input-box .place')
													.val('')
												$('.work-factor .factor-box .input-box .next')
													.val('')
												$('.work-factor .factor-box .input-box .action')
													.val('')
												getWorkstationSite()
											} else {
												toastText(res.msg)
												logout()
											}
										},
										timeout: timeOut,
										error: () => {
											overTime()
										}
									})
								}
							})
						} else {}
					})
				}
			})
			// 编辑新增 工站
			$('.work-factor .factor-box .btn-box .addConfirm').click(function() {
				let name = $('.work-factor .factor-box .input-box .name').val(),
					siteName = $('.work-factor .factor-box .input-box .place').val()
				// action = $('.work-factor .factor-box .input-box .action').val()
				if (!name) {
					toastText('请输入工站名称')
					return false
				}
				if (!siteName) {
					toastText('请选择地点')
					return false
				}
				if (workstationEdit) {
					let data = {
						"id": workstationEditInfo.id,
						name, // 自定义名称
						"operation": workstationEditInfo.operation, //动作
						"siteName": siteName, //地点 名称
						"siteType": 2, //地点类型 0:工作台, 1:停车点 , 2:停止点
						"previousStation": "",
						"plateNumber": '',
						"nextStation": ""

					}
					$.ajax({
						url: `http://${ipValue}:55200/v1/workstation/update`,
						contentType: "application/json",
						data: JSON.stringify(data),
						type: "POST",
						dataType: "json",
						success: (res) => {
							if (res.code == 200) {
								getWorkstationSite()
								toastText('修改成功')
								setTable(getWorkstation())
								$('.work-factor .factor-box .input-box .name').val('')
								$('.work-factor .factor-box .input-box .place').val('')
								// $('.work-factor .factor-box .input-box .next').val('')
								$('.work-factor .factor-box .input-box .action').val('')
								$('.work-factor').hide()
							} else {
								toastText(res.msg)
								logout()
							}
						},
						timeout: timeOut,
						error: () => {
							overTime()
						}
					})
				} else {
					let params = {
						name,
						"operation": "",
						siteName,
						"siteType": 0,
						"previousStation": "",
						"plateNumber": '',
						"nextStation": ""
						// "nextStation": $('.work-factor .factor-box .input-box .next').val()

					}
					$.ajax({
						url: `http://${ipValue}:55200/v1/workstation/add`,
						contentType: "application/json",
						data: JSON.stringify(params),
						type: "POST",
						dataType: "json",
						success: (res) => {
							if (res.code == 200) {
								getWorkstationSite()
								toastText('添加成功')
								setTable(getWorkstation())
								$('.work-factor .factor-box .input-box .name').val('')
								$('.work-factor .factor-box .input-box .place').val('')
								// $('.work-factor .factor-box .input-box .next').val('')
								$('.work-factor').hide()
							} else {
								toastText(res.msg)
								logout()
							}
						},
						timeout: timeOut,
						error: () => {
							overTime()
						}
					})
				}
			})
			$('.work-factor .factor-box .btn-box .addCancel').click(function() {
				$('.work-factor .factor-box .input-box .name').val('')
				$('.work-factor .factor-box .input-box .place').val('')
				// $('.work-factor .factor-box .input-box .action').val('')
				// $('.work-factor .factor-box .input-box .next').val('')
				$('.work-factor').hide()
			})
			//绑定解绑工站
			$('.popup-work-info .table-main').on('click', '.btn-span span', function() {
				let name = $(this).parents('tr').children('.name').text(),
					workstationArr = getWorkstation(),
					info = {},
					other = {},
					flag = $(this).hasClass('unbind')
				var a = workstationArr.find(function(value, index, arr) {
					return value.name == workstation;
				})
				if (!a) {
					if (vehicles) {
						toastText('当前工位已被异常删除,请联系管理员')
					} else {
						workstationArr.map(item => {
							if (name === item.name) {
								info = {
									...item
								}
								updateWorkstation(info, plateNumber)
								workstation = name
								$(".tips-box .workstation").text(workstation)
								info = {
									...item
								}
								info.plateNumber = plateNumber
							}
						})
					}
				}
				workstationArr.map(item => {
					if (name === item.name && !workstation) {
						info = {
							...item
						}
						updateWorkstation(info, plateNumber)
						workstation = name
						$(".tips-box .workstation").text(workstation)
						info.plateNumber = plateNumber
					}
					// 解绑
					if (item.plateNumber === plateNumber && flag) {
						if (hasOrder) {
							toastText('当前工站有订单,暂时无法解绑工站')
							return false
						}

						if (vehicles) {
							mui.confirm('当前工站绑定有车辆,解绑工站,车辆也解绑,是否解绑', '提示', function(e) {
								if (e.index == 1) {
									//解绑 加url
									//http://localhost:55200/v1/resetVehicleAllowedOrderTypes/Vehicle-01?currentOrderType=123
									let url =
										`http://${ipValue}:55200/v1/resetVehicleAllowedOrderTypes/${vehicles}?currentOrderType=${item.name}`
									setVehicleAllowedOrderTypes(url)
									vehicles = ''
									localStorage.setItem('vehicles', '');
									$(".tips-box .vehicles").text('')
									info = {
										...item
									}
									workstation = ''
									localStorage.setItem('workstation', workstation);
									workSite()
									$(".tips-box .workstation").text(workstation)
									updateWorkstation(info, '')
								} else {
									toastText(res.msg)
									logout()
								}
							}, 'div')
						} else {
							other = {
								...item
							}
							updateWorkstation(other)
							workstationArr.map(e => {
								if (e.name === name) {
									info = {
										...e
									}
									updateWorkstation(info, '')
									workstation = ''
									localStorage.setItem('workstation', workstation);
									$(".tips-box .workstation").text(workstation)
									workSite()
								}
							})
						}
						// updateWorkstation(other)
					}
					// 换绑
					if (workstation && !flag) {
						if (hasOrder) {
							toastText('当前工站有订单,暂时无法换绑工站')
							return false
						}
						if (item.plateNumber === plateNumber) {

							if (vehicles) {
								mui.confirm('当前工站绑定有车辆,解绑工站,车辆也解绑,是否解绑', '提示', function(e) {
									if (e.index == 1) {
										//解绑 加url
										let url =
											`http://${ipValue}:55200/v1/resetVehicleAllowedOrderTypes/${vehicles}?currentOrderType=${item.name}`
										setVehicleAllowedOrderTypes(url)
										vehicles = ''
										localStorage.setItem('vehicles', vehicles);
										$(".tips-box .vehicles").text(vehicles)
										other = {
											...item
										}
										workstationArr.map(e => {
											if (e.name === name) {
												info = {
													...e
												}
												workstation = e.name
												localStorage.setItem('workstation',
													workstation);
												$(".tips-box .workstation").text(
													workstation)
												workSite()
											}
										})
										updateWorkstation(other, '')
										updateWorkstation(info, plateNumber)

									} else {

										// return false
									}
								}, 'div')
							} else {
								other = {
									...item
								}
								other.plateNumber = ''
								workstationArr.map(e => {
									if (e.name === name) {
										info = {
											...e
										}
										// updateWorkstation(info,  plateNumber)
										workstation = e.name
										localStorage.setItem('workstation', workstation);
										$(".tips-box .workstation").text(workstation)
										getWorkstationSite()
										workSite()
									}
								})
								updateWorkstation(other, '')
								updateWorkstation(info, plateNumber)
							}

						} else {

						}
					}

				})
			})

			//绑定解绑小车
			$('.popup-vehicle-info .table-main').on('click', '.btn-span span', function() {
				// if (!workstation) {
				// 	toastText('请先选择当前工站')
				// 	return false
				// }
				let name = $(this).parents('tr').children('.name').text(),
					flag = $(this).hasClass('unbind'),
					url = ''

				if (hasOrder) {
					toastText('当前车辆有订单,暂时无法解绑工站')
					return false
				}

				if (flag) {
					url =
						`http://${ipValue}:55200/v1/resetVehicleAllowedOrderTypes/${name}?currentOrderType=${workstation}`
					vehicles = ''
					localStorage.setItem('vehicles', vehicles);
				} else {
					url =
						`http://${ipValue}:55200/v1/setVehicleAllowedOrderTypes/${name}?orderType=${workstation}`
					vehicles = name
				}
				setVehicleAllowedOrderTypes(url)
			})

			$('#android').on('click', 'button', function() {
				$('.popup-vehicles-info').show()
			})
			//    急停
			$('.new-btn-box .stop-box div').click(function() {
				// if (!workstation) {
				// 	toastText('请先选择当前工站')
				// 	return false;
				// }
				// if (!vehicles) {
				// 	toastText('请先选择车辆')
				// 	return false;
				// }
				// let hasClass = $('.new-btn-box .stop-box ').hasClass('active')
				// if (hasClass) {
				// 	toastText('已启动急停')
				// 	return
				// }
				vehiclesType =2
				getVehiclesName()
			})
			$('.new-btn-box .voice-box > div').click(function() {
				// if (!vehicles) {
				// 	toastText('请先选择车辆')
				// 	return false;
				// }
				$(this).removeClass('active').siblings().addClass('active')
				let index = $(this).index()
				let tips = '声音已' + ((index > 0) ? '打开' : '关闭')
				$.ajax({
					//http://localhost:55200/v1/vehicle/voiceSwitch/Vehicle-01?value=1
					url: `http://${ipValue}:55200/v1/vehicle/voiceSwitch/${vehiclesName}?value=${index}`,
					contentType: "multipart/form-data",
					params: vehiclesName,
					type: "post",
					dataType: "json",
					success: (res) => {
						toastText(tips)
					},
					timeout: timeOut,
					error: () => {
						overTime()
					}
				})
			})
			$('.new-btn-box .stop-box div img').hover(
				function() {

					// 鼠标移入时添加apply-class-hoverr类
					$(this).css({
						'width': '120px',
						'height': '120px'
					})
				},
				function() {
					// 鼠标移入时移出apply-class-hoverr类

					$(this).css({
						'width': '116px',
						'height': '116px'
					})
				}
			)

			// 切换模式
			$('.new-btn-box .pattern-box .pattern-list').click(function() {
				let index = $(this).index()
				if (index){
					getVehiclesName()
					vehiclesType = 6
				}else {
					vehiclesName = ''
					vehiclesType = 0
				}
				$(this).addClass('active')
				$(this).siblings().removeClass('active')
				$('.new-btn-box .btn-list .pattern-btn').eq(index).siblings().removeClass('active')
				$('.new-btn-box .btn-list .pattern-btn').eq(index).addClass('active')
				console.log('pattern-list',index,vehiclesType);
			})
			$('.popup-selectVehicles .popup-main .popup-img-box').on('click', '.select-img', function(){
				vehiclesName = $(this).find('span').text(),type=  $(this).find('i').text()
				$(this).addClass('active').siblings().removeClass('active')
				onceOrdel(type)
			})
			// 遥控模式
			$('.new-btn-box .pattern-btn .second-box .one-box .second-list .btn-box').on('touchstart', function() {
				let index = $(this).index()
				let parentIndex = $(this).parent().index()
				let url='',msg=''
				// 	前进
				if (index === 0 && parentIndex === 0) {
					// action(0)
					// $('.new-btn-box .pattern-btn .second-box .btn-box').removeClass('active')
					// $(this).addClass('active')
					url =`http://${ipValue}:55200/v1/vehicle/forward/${vehiclesName}`
					msg = '开始前进'
				}
				// 后退
				else if (index === 0 && parentIndex === 1) {
					  url= `http://${ipValue}:55200/v1/vehicle/backoff/${vehiclesName}`
					  msg = '开始后退'
					// action(1)
					// $('.new-btn-box .pattern-btn .second-box .btn-box').removeClass('active')
					// $(this).addClass('active')
				} else if (index === 1 && parentIndex === 1) {
				//    右微调
					url= `http://${ipValue}:55200/v1/vehicle/righttrim/${vehiclesName}?value=1`
					msg ='开始右微调'

				}
				// 左微调
				else if (index === 1 && parentIndex === 0) {
					msg = '开始左微调'
					url= `http://${ipValue}:55200/v1/vehicle/lefttrim/${vehiclesName}?value=1`
					/* $(this).parent('.second-list').parent().parent('.second-box').siblings().children()
						.children()
						.children('.btn-box').removeClass('active')
					$(this).addClass('active') */
				}
				$(this).parent('.second-list').parent().parent('.second-box').siblings().children()
					.children()
					.children('.btn-box').removeClass('active')
				$(this).addClass('active')
				// longPress(toRechargeWithType(url,msg), 1000)
				timeoutId = setInterval(toRechargeWithType, 30,url,msg);

			});
			$('.new-btn-box .pattern-btn .second-box .three-box .second-list .btn-box').on('touchstart', function() {
				let index = $(this).index()
				let parentIndex = $(this).parent().index()
				let url='',msg=''
				// 	左旋转
				if (index === 0 && parentIndex === 0) {
					// action(0)
					// $('.new-btn-box .pattern-btn .second-box .btn-box').removeClass('active')
					// $(this).addClass('active')
					url =`http://${ipValue}:55200/v1/vehicle/leftrotation/${vehiclesName}`
					msg = '开始左旋转'
				}
				// 右旋转
				else if (index === 0 && parentIndex === 1) {
					  url= `http://${ipValue}:55200/v1/vehicle/rightrotation/${vehiclesName}`
					  msg = '开始右旋转'
					// action(1)
					// $('.new-btn-box .pattern-btn .second-box .btn-box').removeClass('active')
					// $(this).addClass('active')
				} else if (index === 1 && parentIndex === 1) {
				//    右横移
					url= `http://${ipValue}:55200/v1/vehicle/righttraverse/${vehiclesName}`
					msg ='开始右横移'

				}
				// 左横移
				else if (index === 1 && parentIndex === 0) {
					msg = '开始左横移'
					url= `http://${ipValue}:55200/v1/vehicle/lefttraverse/${vehiclesName}`
					/* $(this).parent('.second-list').parent().parent('.second-box').siblings().children()
						.children()
						.children('.btn-box').removeClass('active')
					$(this).addClass('active') */
				}
				$(this).parent('.second-list').parent().parent('.second-box').siblings().children()
					.children()
					.children('.btn-box').removeClass('active')
				$(this).addClass('active')
				// longPress(toRechargeWithType(url,msg), 1000)
				console.log(msg);
				timeoutId = setInterval(toRechargeWithType, 30,url,msg);

			});
			$('.new-btn-box .pattern-btn .second-box .one-box .second-list .btn-box').on('touchend', function() {
				let index = $(this).index(),url='',msg=''
				let parentIndex = $(this).parent().index()
				if (index === 0 ) {
					if	(parentIndex === 0){
						msg = '前进结束'
					}else if(parentIndex === 1){
					// 后退
						msg = '后退结束'
					}
					toastText(msg)
				} else if (index ===1) {
					if	( parentIndex === 0){
						// 左微调
						url= `http://${ipValue}:55200/v1/vehicle/lefttrim/${vehiclesName}?value=0`,
						msg = '结束左微调'
					}else if(parentIndex === 1){
						//   右微调
						url = `http://${ipValue}:55200/v1/vehicle/righttrim/${vehiclesName}?value=0`
						msg = '结束右微调'

					}
					 toRechargeWithType(url,msg)
				}
				clearInterval(timeoutId);
				timeoutId =null
				withTypeIndex = 1
				$(this).parent('.second-list').parent().parent('.second-box').siblings().children().children()
					.children('.btn-box').removeClass('active')
				$(this).removeClass('active')
			});
			$('.new-btn-box .pattern-btn .second-box .three-box .second-list .btn-box').on('touchend', function() {
				let index = $(this).index(),url='',msg=''
				let parentIndex = $(this).parent().index()
				if (index === 0 ) {
					if	(parentIndex === 0){
						msg = '左旋转结束'
					}else if(parentIndex === 1){
					// 后退
						msg = '右旋转结束'
					}
					toastText(msg)
				} else if (index ===1) {
					if	( parentIndex === 0){
						// 左横移
						// url= `http://${ipValue}:55200/v1/vehicle/lefttrim/${vehiclesName}?value=0`,
						msg = '结束左横移'
					}else if(parentIndex === 1){
						//   右横移
						// url = `http://${ipValue}:55200/v1/vehicle/righttrim/${vehiclesName}?value=0`
						msg = '结束右横移'

					}
					 // toRechargeWithType(url,msg)
				}
				url = `http://${ipValue}:55200/v1/vehicle/stopmove/${vehiclesName}`
				toRechargeWithType(url,msg)
				clearInterval(timeoutId);
				timeoutId =null
				withTypeIndex = 1
				$(this).parent('.second-list').parent().parent('.second-box').siblings().children().children()
					.children('.btn-box').removeClass('active')
				$(this).removeClass('active')
			});

			//避障
			$('.new-btn-box .pattern-btn .zero .zero-box .btn-box').on('touchend', function() {
				// if (!workstation) {
				// 	toastText('请先选择当前工站')
				// 	return false;
				// }
				// if (!vehicles) {
				// 	toastText('请先选择车辆')
				// 	return false;
				// }
				// if (chargingState != 2) {
				// 	toastText('不能移动，请注意充电状态')
				// 	return false;
				// }
				$.ajax({
					url: `http://${ipValue}:55200/v1/vehicle/obstacleAvoidance/${vehiclesName}?value=1`,
					contentType: "application/json",
					params: vehiclesName,
					type: "post",
					dataType: "json",
					success: (res) => {
						toastText('打开避障')
					},
					timeout: timeOut,
					error: () => {
						overTime()
					}
				})
				console.log(vehiclesName ,1,'obstacleAvoidance');
				// $('.new-btn-box .pattern-btn .second-box .btn-box').removeClass('active')
				$(this).removeClass('active')
			});
			$('.new-btn-box .pattern-btn .zero .zero-box .btn-box').on('touchstart', function() {
				// if (!workstation) {
				// 	toastText('请先选择当前工站')
				// 	return false;
				// }
				// if (!vehicles) {
				// 	toastText('请先选择车辆')
				// 	return false;
				// }
				// if (chargingState != 2) {
				// 	toastText('不能移动，请注意充电状态')
				// 	return false;
				// }

				$.ajax({
					// http://localhost:55200/v1/vehicle/obstacleAvoidance/Vehicle-01?value=1
					url: `http://${ipValue}:55200/v1/vehicle/obstacleAvoidance/${vehiclesName}?value=0`,
					contentType: "application/json",
					params: vehiclesName,
					type: "post",
					dataType: "json",
					success: (res) => {
						toastText('关闭避障')
					},
					timeout: timeOut,
					error: () => {
						overTime()
					}
				})
				console.log(vehiclesName , 2 ,"obstacleAvoidance");
				// $('.new-btn-box .pattern-btn .second-box .btn-box').removeClass('active')
				// $(this).parent().children('.btn-box').removeClass('active')
				$(this).addClass('active')
			});
			// $('.new-btn-box .pattern-btn .second-box .one-box .second-list .btn-box')
			$('.new-btn-box .pattern-btn .second-box .one-box .second-list .btn-box').click(function() {
				let index = $(this).index()
				let parentIndex = $(this).parent().index()
				console.log(5555);
				// if (!workstation) {
				// 	toastText('请先选择当前工站')
				// 	return false;
				// }
				// if (!vehicles) {
				// 	toastText('请先选择车辆')
				// 	return false;
				// }
				// if (chargingState != 2) {
				// 	toastText('不能移动，请注意充电状态')
				// 	return false;
				// }
				/* // 	前进
				if (index === 0 && parentIndex === 0) {
					action(0)
					$('.new-btn-box .pattern-btn .second-box .btn-box').removeClass('active')
					$(this).addClass('active')
				}
				// 后退
				else if (index === 0 && parentIndex === 1) {
					action(1)
					$('.new-btn-box .pattern-btn .second-box .btn-box').removeClass('active')
					$(this).addClass('active')
				} else {
					// $(this).parent('.second-list').parent().parent('.second-box').siblings().children().children().children('.btn-box').removeClass('active')
					return
				} */

			})
			$('.new-btn-box .pattern-btn .second-box .two-box .second-list .btn-box').click(function() {
				let index = $(this).index()
				let parentIndex = $(this).parent().index()
				// if (!workstation) {
				// 	toastText('请先选择当前工站')
				// 	return false;
				// }
				// if (!vehicles) {
				// 	toastText('请先选择车辆')
				// 	return false;
				// }
				if (parentIndex === 0) {
					//  进入充电桩
					if (index === 0) {
						// if (chargingState != 2) {
						// 	toastText('不能移动，请注意充电状态')
						// 	return false;
						// }
						$.ajax({
							url: `http://${ipValue}:55200/v1/vehicle/enteringChargePoint/${vehiclesName}`,
							contentType: "multipart/form-data",
							params: vehiclesName,
							type: "post",
							dataType: "json",
							success: (res) => {
								if(res.code == 200){
									toastText('进入充电桩')
								}else{
									toastText(res.msg)
								}
							},
							timeout: timeOut,
							error: () => {
								overTime()
							}
						})
					}
					//  开始充电
					if (index === 1) {
						$.ajax({
							url: `http://${ipValue}:55200/v1/vehicle/chargingstart/${vehiclesName}`,
							contentType: "multipart/form-data",
							params: vehiclesName,
							type: "post",
							dataType: "json",
							success: (res) => {
								if(res.code == 200){
									toastText('开始充电')
								}else{
									toastText(res.msg)
								}
							},
							timeout: timeOut,
							error: () => {
								overTime()
							}
						})
					}
					//   结束充电
					if (index === 2) {
						$.ajax({
							url: `http://${ipValue}:55200/v1/vehicle/chargingend/${vehiclesName}`,
							contentType: "multipart/form-data",
							params: vehiclesName,
							type: "post",
							dataType: "json",
							success: (res) => {
								if(res.code == 200){
									toastText('结束充电')
								}else{
									toastText(res.msg)
								}
							},
							timeout: timeOut,
							error: () => {
								overTime()
							}
						})
					}

				} else if (parentIndex === 1) {

					//  顶升
					if (index === 0) {
						$.ajax({
							// url: `http://${ipValue}:55200/v1/vehicle/lefttraverse/${vehicles}`,
							// http://localhost:55200/v1/vehicle/load/Vehicle-01
							url: `http://${ipValue}:55200/v1/vehicle/load/${vehiclesName}`,
							contentType: "multipart/form-data",
							params: vehiclesName,
							type: "post",
							dataType: "json",
							success: (res) => {
								if(res.code == 200){
									toastText('开始 顶升')
								}else{
									toastText(res.msg)
								}
							},
							timeout: timeOut,
							error: () => {
								overTime()
							}
						})
					}
					//顶落
					if (index === 1) {
						$.ajax({
							// url: `http://${ipValue}:55200/v1/vehicle/righttraverse/${vehicles}`,
							url: `http://${ipValue}:55200/v1/vehicle/unload/${vehiclesName}`,
							//http://localhost:55200/v1/vehicle/unload/Vehicle-01
							contentType: "multipart/form-data",
							params: vehiclesName,
							type: "post",
							dataType: "json",
							success: (res) => {
								if(res.code == 200){
									toastText('开始顶落')
								}else{
									toastText(res.msg)
								}
							},
							timeout: timeOut,
							error: () => {
								overTime()
							}
						})
					}
					//  重启
					if (index === 2) {
						var btnArray = ['重启', '取消'];
						mui.confirm('您确定重启?', '', btnArray, function(e) {
							if (e.index == 0) {
								// 确认重启触发事件

								$.ajax({
									//http://localhost:55200/v1/vehicle/restart/Vehicle-01
									url: `http://${ipValue}:55200/v1/vehicle/restart/${vehiclesName}`,
									contentType: "multipart/form-data",
									params: vehiclesName,
									type: "post",
									dataType: "json",
									success: (res) => {
										if(res.code == 200){
											toastText('开始重启')
										}else{
											toastText(res.msg)
										}
									},
									timeout: timeOut,
									error: () => {
										overTime()
									}
								})
							} else {}
						})
					}
				}
				$('.new-btn-box .pattern-btn .second-box .btn-box').removeClass('active')
				$(this).parent().children('.btn-box').removeClass('active')
				$(this).addClass('active')
				setTimeout(function() {
					$('.new-btn-box .pattern-btn .second-box .btn-box').removeClass('active')
					$(this).removeClass('active')
				}, 1000)
			})
			// $('.new-btn-box .pattern-btn .second-box .three-box .second-list .btn-box').click(function() {
			// 	let index = $(this).index()
			// 	let parentIndex = $(this).parent().index()
			// 	$('.new-btn-box .pattern-btn .second-box .btn-box').removeClass('active')
			// 	$(this).addClass('active')
			// 	if (parentIndex === 0) {
			// 		// 左横移
			// 		if (index === 1) {
			// 			action(2)
			// 			console.log( "左横移");
			// 		}
			// 		//左旋转
			// 		if (index === 0) {
			// 			action(3)
			// 			console.log('左旋转');
			// 		}
			// 	} else if (parentIndex === 1) {
			// 		// 右横移
			// 		if (index === 1) {
			// 			action(4)
			// 			console.log('右横移');
			// 		}
			// 		// 	右旋转
			// 		if (index === 0) {
			// 			action(5)
			// 			console.log('右旋转');
			// 		}
			// 	}

			// })
			//    调度
			$('.new-btn-box .btn-list .first .btn-box').click(function() {
				// if (!workstation) {
				// 	toastText('请先选择当前工站')
				// 	return false;
				// }
				// if (!vehicles) {
				// 	toastText('请先选择车辆')
				// 	return false;
				// }
				let index = $(this).index()
				//    停止
				// if (index === 0) {
				// 	if (!hasOrder) {
				// 		toastText('当前小车为空闲状态')
				// 		return false
				// 	}
				// 	$.ajax({
				// 		url: `http://${ipValue}:55200/v1/transportOrders/${orderNum}/cancel?immediate=true&disableVehicle=false`,
				// 		contentType: "multipart/form-data",
				// 		data: '',
				// 		type: "post",
				// 		dataType: "json",
				// 		success: (res) => {
				// 			if (res.code == 200) {
				// 				$.ajax({
				// 					url: `http://${ipValue}:55200/v1/vehicles/${vehicles}/withdrawal?immediate=true&disableVehicle=false`,
				// 					contentType: "multipart/form-data",
				// 					data: '',
				// 					type: "post",
				// 					dataType: "json",
				// 					success: (res) => {
				// 						toastText('停止成功')
				// 					}
				// 				})
				// 			}
				// 		},
				// 		timeout: timeOut,
				// 		error: () => {
				// 			overTime()
				// 		}
				// 	})
				// }
				//一键充电
				if (index == 0) {
					// if (hasOrder) {
					// 	toastText('当前车辆有订单,暂时无法充电')
					// 	return false
					// }
					// if (loadState == 0 || loadState == 1) {
					// 	toastText('当前车辆为负载状态,暂时无法充电')
					// 	return false
					// }
					vehiclesType =1
					getVehiclesName()
				}
				// 指定工站
				if (index === 1) {
					vehiclesType = 5
					getVehiclesName()
				}
				// 取消订单
				if (index === 2) {
					vehiclesType = 3
					getVehiclesName()
				}

				// 重定位
				// if (index === 2) {
				// 	$('.popup-reposition').show()
				// }
				// 多个工站
				// if (index === 3) {
				// 	if (hasOrder) {
				// 		toastText('当前车辆有订单,暂时无法创建新订单')
				// 		return false
				// 	}
				// 	let data = getWorkstation(),val=''
				// 	data.map(item=>{
				// 		val +=`
				// 			<button class="mui-btn mui-btn-primary" value='${item.siteName}'>${item.name}</button>
				// 		`
				// 	})
				// 	$('.popup-multiple-station .popup-main .popup-btn-box').html(val)
				// 	$('.popup-multiple-station').show()
				// }
				$(this).addClass('active')
				$(this).siblings().removeClass('active')
				setTimeout(function() {
					$('.operate-box .btn-list .btn-box').eq(index).removeClass('active')
				}, 2000)
			})

			$('.popup-workStation .confirm').click(function (){
				let data = [],type = $('.popup-workStation .order-main .order-radio input:radio:checked').val(),val = $('.popup-workStation .order-main .order-input input ').val()
				console.log(type);
				workStationTypeAll.map((item,index)=>{
					console.log(item);
					if (type ){
						if (type===item.value){
							data= workStationTypeAll[index].children
						}
					}else {
						if (item.children && item.children.length){
							item.children.map(e=>{
								data.push(e)
							})
						}
					}
				})
				let arr =[]
				if (val){
					data.map(item=>{
						let _i = item.value.indexOf(val)
						if (_i > -1){
							arr.push(item)
						}else {

						}
					})
				}else {
					arr = data
				}


				let picker = new mui.PopPicker({
					layer:2
				})
				// if (hasOrder) {
				// 	toastText('当前车辆有订单,暂时无法创建新订单')
				// 	return false
				// }
				// mui.showLoading("正在加载工站..","div");

				picker.setData(arr)
				// picker.pickers[0].setSelectedIndex(1);
				// picker.pickers[1].setSelectedIndex(1);

				picker.show(function(SelectedItem) {
					work = SelectedItem[0].text
					action = SelectedItem[1].value
					if (!work) {
						$(this).removeClass('active')
						return false
					}
					if (action == "Charging" && (loadState == 0 || loadState == 1)) {
						toastText('当前车辆为负载状态,暂时无法充电')
						return false
					}
					getWorkstation().map(item => {
						if (work === item.name) {
							let data = [{
								"operation": action,
								"locationName": item.siteName,
								"properties": [{}]
							}]
							// getOrder(data)
							vehiclesType= 4
							orderInfo = data
							getVehiclesName()
							// $('.popup-box').hide()
						} else {}
					})
				})

				mui.hideLoading();
			})
			$('.popup-multiple-station .popup-main .popup-btn-box').on('click', '.mui-btn', function() {
			 	let siteName = $(this).val(),workstation=$(this)[0].innerText
				let arr = [],
						list = [],
						picker = new mui.PopPicker(),
						btnArray = ['是', '否'],
						locationList = getLocations(),
						type = ''
				mui.confirm(`您确定添加${workstation}?`, '', btnArray, function (e) {

					if (e.index == 0) {
						locationList.map(item => {
							if (siteName === item.name) {
								type = item.type.name
							}
						})
						list = locationType(type)
						// 确认触发事件locationType(d.siteName)
						list.map(e => {
							arr.push({
								value: e.value,
								text: e.text
							})
						})
						picker.setData(arr)
						picker.show(function (selectItems) {
							lineArr.push({
								"operation": selectItems[0].value,
								"locationName": siteName,
								text: selectItems[0].text,
								workstation
							})
							getOrderList(lineArr)
						})
					}
				})
			})
			$('.popup-reposition .mui-input-row').bind("change", function(e) {
				let val = e.target.value
				$(this).next('div').children('input').val(val)
			})
			$('.popup-reposition .flex-box .input-box input').blur(function(e) {
				let val = e.target.value
				$(this).parent('div').siblings('.mui-input-row').children('input').val(val)
			})

			$('.popup-reposition .popup-footer .confirm').click(function() {
				let x = $('#x-input input').val(),
					y = $('#y-input input').val(),
					angle = $('#angle-input input').val()
				if (x.length == 0) {
					toastText('请输入x轴坐标')
					return false
				}
				if (y.length == 0) {
					toastText('请输入x轴坐标')
					return false
				}
				if (angle.length == 0) {
					toastText('请输入x轴坐标')
					return false
				}
				let data = {
					x,
					y,
					angle,
					z: 0
				}
				$.ajax({
					url: `http://${ipValue}:55200/v1/vehicle/reposition/${vehicles}`,
					contentType: "multipart/form-data",
					data: JSON.stringify(data),
					type: "POST",
					dataType: "json",
					success: (res) => {

						if (res.code == 200) {
							toastText('重定位成功')
							$('.popup-reposition').hide()
							returnZero()
						} else {
							backErr(res.msg)
						}
					},
					timeout: timeOut,
					error: () => {
						overTime()
					}
				})
			})

			function returnZero() {
				$('.popup-reposition .popup-main input').val('')
			}

			// let dataJson =


			// function getWorkstationSite(){
			// 	// 获取工站信息
			// 	console.log(getWorkstation());
			// }

			//
			$(".new-btn-box .stop-btn.switch-box .low-btn").click(function() {
				// if (!vehicles) {
				// 	toastText('请先选择车辆')
				// 	return false;
				// }
				if (energyLevel > 20) {
					toastText('电量大于20%,暂不用解除电量限制')
					return false
				}
				//v1/vehicle/lowBatteryRelease/Vehicle-01
				$.ajax({
					url: `http://${ipValue}:55200/v1/vehicle/lowBatteryRelease/${vehicles}`,
					contentType: "multipart/form-data",
					data: '',
					type: "post",
					async: !workInfo,
					dataType: "json",
					success: (res) => {
						if (res.code == 200) {
							toastText('解除电量限制成功')
							$(this).addClass('active')
						}else{
							backErr(res.msg)
						}

					},
					timeout: timeOut,
					error: () => {
						overTime()
					}
				})
				setTimeout('$(".new-btn-box .stop-btn.switch-box .low-btn").removeClass("active")', 3000)
			})
			// 切换手动自动
			$('.switch-box .mui-switch-posit').click(function() {
				// if (!vehicles) {
				// 	toastText('请先添加车辆')
				// 	return false
				// }

				if (!switchFalg) {
					return false
				}
				let flag = false,
					val = 0,
					tips = '自动模式'
				flag = $('.switch-box .mui-switch').hasClass('mui-active')
				val = flag ? 1 : 0
				controlModelSwitchFalg = false
				if (flag) {
					$('.switch-box .mui-switch').removeClass('mui-active')
					$(".mui-switch-handle").attr("style", "");
				} else {
					// $(".mui-switch-handle").attr("style","");
					$('.switch-box .mui-switch').addClass('mui-active')
				}
				mui.showLoading("正在加载..", "div");
				$.ajax({
					url: `http://${ipValue}:55200/v1/vehicle/controlModelSwitch/${vehicles}?value=${val}`,
					contentType: "multipart/form-data",
					data: '',
					type: "post",
					async: !workInfo,
					dataType: "json",
					success: (res) => {
						if (res.code == 200) {

						}else{
							backErr(res.msg)
						}
					},
					timeout: timeOut,
					error: () => {
						overTime()
					}
				})
				switchFalg = false
				setTimeout(switchFalgToTrue, 1000)
			})


			$('.operate-box .order-list .order-main ').on('click', '.operate-details div', function() {
				lineIndex = $(this).parent().index()
				$(this).parent().addClass('active')
				$(this).parent().siblings().removeClass('active')

			})
			$('.operate-box .order-list .order-btn div').click(function() {
				if (lineArr && lineArr) {

				} else {
					toastText('请先添加工站')
					return false
				}
				let index = $(this).index()
				if (index === 0) {
					let data = []
					lineArr.map(item => {
						data.push({
							"operation": item.operation,
							"locationName": item.locationName,
							"properties": [{}],
						})
					})
					getOrder(data)
					console.log(666);
					lineArr = []
					getOrderList(lineArr)
					lineIndex = -1
				} else if (index === 1) {


					if (lineIndex > -1) {
						let name = lineArr[lineIndex].locationName,
							arr = [],
							list = [],
							picker = new mui.PopPicker(),
							locationList = getLocations(),
							type = ''
						locationList.map(item => {
							if (name === item.name) {
								type = item.type.name
							}
						})
						list = locationType(type)

						// 确认触发事件locationType(d.siteName)
						list.map(e => {
							arr.push({
								value: e.value,
								text: e.text
							})
						})
						picker.setData(arr)
						picker.show(function(selectItems) {

							lineArr[lineIndex].text = selectItems[0].text
							lineArr[lineIndex].operation = selectItems[0].value
							getOrderList(lineArr)
							lineIndex = -1
						})
					} else {
						toastText('请先选择工站')
					}
				} else if (index === 2) {
					var btnArray = ['取消', '返回'];
					mui.confirm('您确定取消?', '', btnArray, function(e) {
						if (e.index == 0) {
							lineArr = []
							getOrderList(lineArr)
							lineIndex = -1
						}
					})

				} else if (index === 3) {
					if (lineIndex > -1) {
						var btnArray = ['删除', '取消'];
						mui.confirm(`您确定删除${lineArr[lineIndex].workstation}?`, '', btnArray, function(e) {
							if (e.index == 0) {
								lineArr.splice(lineIndex, 1)
								getOrderList(lineArr)
								lineIndex = -1
							}
						})
					} else {
						toastText('请先选择工站')
					}
				}
			})


			// s\设置ip


			function muiHideLoading(text = "修改成功") {
				mui.hideLoading();
				toastText(text)
			}

			// 网络错误
			document.addEventListener('plusready', function() {

				function setStorageAsync() {
					plus.storage.setItemAsync("test", "test with HBuilderX", function() {
						console.log("setItemAsync success");
					}, function(e) {
						console.log("setItemAsync failed: " + JSON.stringify(e));
					});
				}
			})
		})
	</script>

</html>
